kpse_include ../make/paths.mk
kpse_include ../make/common.mk
kpse_include ../make/programs.mk

CXX = c++
OBJC = cc
CXXLD = $(CXX)
cxx_link_command = $(CXXLD) -o $@ $(LDFLAGS)
kpathsea_cxx_link = $(LIBTOOL) --mode=link $(cxx_link_command)

ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) -I. -I$(srcdir)
ALL_OBJCFLAGS = @DEFS@ $(XXOBJCFLAGS) -I. -I$(srcdir)

.SUFFIXES: .cpp .o .m
.cpp.o:
	$(CXX) $(ALL_CXXFLAGS) -c $<
.m.o:
	$(OBJC) $(ALL_OBJCFLAGS) -c $<

FRAMEWORKS = \
	-framework Carbon \
	-framework QuickTime

FRAMEWORKS_t1w = -framework Cocoa
LIBS_t1w = -lm

program = xdv2pdf
t1wrap = T1Wrap
programs = $(program) $(t1wrap)
default all: $(programs)

objects=xdv2pdf_main.o xdv2pdf.o xdv2pdf_specials.o

objects_t1w=T1Wrap.o SimplePSInterpreter.o

$(objects): Makefile
$(objects_t1m): Makefile

$(program): $(objects) $(kpathsea) $(ALL_LIBS_DEP)
	$(kpathsea_cxx_link) $(objects) $(FRAMEWORKS) $(LOADLIBES)

$(t1wrap): $(objects_t1w)
	$(CC) -o $@ $(objects_t1w) $(FRAMEWORKS_t1w) $(LIBS_t1w)

T1Wrap.o: $(srcdir)/T1Wrap.m
	$(OBJC) $(ALL_OBJCFLAGS) -c $<

SimplePSInterpreter.o: $(srcdir)/SimplePSInterpreter.m
	$(OBJC) $(ALL_OBJCFLAGS) -c $<

kpse_include ../make/tkpathsea.mk

install: install-exec install-data
uninstall: uninstall-exec uninstall-data

distclean::
	$(RM) config.h

install-exec:
	$(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
	$(INSTALL_LIBTOOL_PROG) $(program) $(bindir)
	$(INSTALL) $(t1wrap) $(bindir)

uninstall-exec:
	cd $(bindir); rm -f $(programs)

install-data:
	$(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir)

uninstall-data:

kpse_include ../make/config.mk

info dvi check:

kpse_include ../make/clean.mk
kpse_include ../make/rdepend.mk
kpse_include depend.mk
